package com.deprecated.patch;

import java.awt.Color;

import javax.swing.Icon;
import javax.swing.JLabel;

import com.panopset.java.Version;
import com.panopset.sf.FontManager;

/**
 * Standard Panopset Swing label.
 *
 * @author Karl Dinwiddie
 *
 */
public class TLabel extends JLabel {
	
	FontManager fm = FontManager.getInstance();

    /**
     * Default foreground color.
     */
    private static final Color DEFAULT_FGCOLOR = Color.BLACK;

    public TLabel() {
        this("", null, LEADING);
    }


    public TLabel(String text) {
        this(text, null, LEADING);
    }

    public TLabel(String text, FontManager.FontType fontType) {
        this(text, null, LEADING, fontType);
    }

    public TLabel(String text, int horizontalAlignment) {
        this(text, null, horizontalAlignment);
    }


    public TLabel(Icon image, int horizontalAlignment) {
        this(null, image, horizontalAlignment);
    }

    public TLabel(Icon image) {
        this(null, image, CENTER);
    }

    public TLabel(String text, Icon icon, int horizontalAlignment) {
        this(text, icon, horizontalAlignment, FontManager.FontType.boldArial);
    }


    public TLabel(String text, Icon icon, int horizontalAlignment,
            FontManager.FontType fontType) {
        super(text, icon, horizontalAlignment);
        setBackground(LookAndFeel.Colors.BG_COLOR.getColor());
        fm.register(this, fontType);
        setForeground(DEFAULT_FGCOLOR);
    }

    /**
     * Serial version number.
     */
    private static final long serialVersionUID = Version.UNI_VERSION;
}
